/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.master.opname.itemdetail;

import com.buanalintas.bynga.Action;
import com.buanalintas.bynga.Controller;
import com.buanalintas.bynga.Field;
import com.buanalintas.bynga.Page;
import com.ronsicecream.pos.entities.PosTransactionOpnameItemDetail;

/**
 *
 * @author user
 */
public class OpnameItemDetail extends Page {

    private Field opnameDetailId;
    private Field opnameDetailOldValue;
    private Field opnameDetailNewValue;
    private Field opnameDetailDescription;
    private Field opnameDetailOpnameId;
    private Field opnameDetailStatusId;
    private Field opnameDetailSatuanId;
    private Field opnameDetailItemId;

    public OpnameItemDetail() {
        super();

        setTheClass(PosTransactionOpnameItemDetail.class);




        opnameDetailId = new Field();
        opnameDetailId.setName("opnameDetailId");
        opnameDetailId.setCaption("id");
        opnameDetailId.setListProperties("");
        opnameDetailId.setInputProperties("");
        getFields().add(opnameDetailId);

        opnameDetailOpnameId = new Field();
        opnameDetailOpnameId.setName("opnameDetailOpnameId");
        opnameDetailOpnameId.setCaption("opname");
        opnameDetailOpnameId.setListProperties("");
        opnameDetailOpnameId.setInputProperties("");
        getFields().add(opnameDetailOpnameId);

        opnameDetailItemId = new Field();
        opnameDetailItemId.setName("opnameDetailItemId");
        opnameDetailItemId.setCaption("item");
        opnameDetailItemId.setListProperties(" align=\"left\" width=\"30%\" nowrap");
        opnameDetailItemId.setInputProperties("");
        opnameDetailItemId.setRequired(true);
        opnameDetailItemId.getSelectorColumns().add(new String[]{"itemName", " Nama", "width=\"40%\""});
        opnameDetailItemId.getSelectorColumns().add(new String[]{"itemCode", " Code", "width=\"10%\" nowrap"});
        opnameDetailItemId.getSelectorColumns().add(new String[]{"itemTypeId", " Type", "width=\"20%\""});
        opnameDetailItemId.getSelectorColumns().add(new String[]{"itemMinimum", " Minimum", "width=\"10%\""});
        opnameDetailItemId.getSelectorColumns().add(new String[]{"itemSatuanId", " Satuan", "width=\"10%\""});
        opnameDetailItemId.getSelectorColumns().add(new String[]{"itemRasaId", " Rasa", "width=\"10%\""});
        opnameDetailItemId.setSelectorOrder("t.itemCode");
        getFields().add(opnameDetailItemId);

        opnameDetailStatusId = new Field();
        opnameDetailStatusId.setName("opnameDetailStatusId");
        opnameDetailStatusId.setCaption("status");
        opnameDetailStatusId.setListProperties(" align=\"left\" width=\"10%\" nowrap");
        opnameDetailStatusId.setInputProperties(" ");
        opnameDetailStatusId.setInputType(Field.INPUT_COMBO_BOX);
        opnameDetailStatusId.setRequired(true);
        getFields().add(opnameDetailStatusId);


//        opnameDetailSatuanId = new Field();
//        opnameDetailSatuanId.setName("opnameDetailSatuanId");
//        opnameDetailSatuanId.setCaption("satuan");
//        opnameDetailSatuanId.setListProperties(" align=\"left\" width=\"30%\" nowrap");
////        opnameDetailSatuanId.setEntityRelation(PosMasterSize.class);
//        opnameDetailSatuanId.setRequired(true);
//        getFields().add(opnameDetailSatuanId);

        opnameDetailOldValue = new Field();
        opnameDetailOldValue.setName("opnameDetailOldValue");
        opnameDetailOldValue.setCaption("old value");
        opnameDetailOldValue.setListProperties(" align=\"right\" width=\"10%\" nowrap");
        opnameDetailOldValue.setInputProperties(" size=\"10\"");
        getFields().add(opnameDetailOldValue);

        opnameDetailNewValue = new Field();
        opnameDetailNewValue.setName("opnameDetailNewValue");
        opnameDetailNewValue.setCaption("new value");
        opnameDetailNewValue.setListProperties(" align=\"right\" width=\"5%\" nowrap");
        opnameDetailNewValue.setInputProperties(" size=\"10\"");
        opnameDetailNewValue.setRequired(true);
        getFields().add(opnameDetailNewValue);

        opnameDetailDescription = new Field();
        opnameDetailDescription.setName("opnameDetailDescription");
        opnameDetailDescription.setCaption("description");
        opnameDetailDescription.setListProperties(" width=\"50%\"");
        opnameDetailDescription.setInputProperties(" cols=\"50\" rows=\"5\"");
        opnameDetailDescription.setInputType(Field.INPUT_TEXT_AREA);
        opnameDetailDescription.setInputCase(Field.CASE_UPPER);
        getFields().add(opnameDetailDescription);

        fillFields();

        getFieldsAdd().clear();
        getFieldsAdd().add(opnameDetailItemId);
//        getFieldsAdd().add(opnameDetailSatuanId);
//        getFieldsAdd().add(opnameDetailStatusId);
        getFieldsAdd().add(opnameDetailNewValue);
        getFieldsAdd().add(opnameDetailDescription);

        getFieldsEdit().clear();
        getFieldsEdit().add(opnameDetailItemId);
//        getFieldsEdit().add(opnameDetailSatuanId);
//        getFieldsEdit().add(opnameDetailStatusId);
        getFieldsEdit().add(opnameDetailNewValue);
        getFieldsEdit().add(opnameDetailDescription);

        getFieldsList().clear();
        getFieldsList().add(opnameDetailItemId);
//        getFieldsList().add(opnameDetailSatuanId);
        getFieldsList().add(opnameDetailStatusId);
        getFieldsList().add(opnameDetailOldValue);
        getFieldsList().add(opnameDetailNewValue);
        getFieldsList().add(opnameDetailDescription);

        getActions().add(Action.TRANS_DETAIL_LIST);
        getActions().add(Action.TRANS_DETAIL_ADD);
        getActions().add(Action.TRANS_DETAIL_EDIT);

        setController(new Controller(this));
    }
}
